home *** CD-ROM | disk | FTP | other *** search
- #include <fcntl.h>
- #include <io.h>
- #include <stdio.h>
-
- #include "myfile.h"
-
- //:::::::::::::::[ CLASS myfile MEMBER DECLARATIONS ]:::::::::::::::::::::::
-
- // CONSTRUCTOR (CURRENTLY NOT USED, SET UP FOR FUTURE PURPOSES)
- //
- myfile::myfile(){
- handle=-1;
- }
-
- // OPEN FILE AND RETURN STATUS (0=GOOD -1=ERROR)
- // BY DEFAULT ONLY PATHNAME IS REQUIRED. IF NO ACCESS OR MODE IS SPECIFIED
- // mopen WILL USE int mopen(pathname, O_RDONLY|O_BINARY|O_DENYNONE, 0)
- //
- int myfile::mopen(const char *path, int access, int mode){
- if ((handle = open(path, access, mode))==-1){
- perror("Error:");
- return(handle);
- }
- return(0);
- }
-
- // CLOSE FILE PREVIOUSLY OPENED WITH mopen()
- //
- void myfile::mclose(){
- close(handle);
- }
-
-
-